home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 December / CHIP Turkiye Aralık 1997.iso / oyunlar / weltdemo / inst / vfw / disk1 / setup.mst < prev    next >
Text File  |  1997-01-17  |  10KB  |  259 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40.  
  41. INIT:
  42.  
  43.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  44.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  45.  
  46.     WIN32ENABLED% = 0
  47.     MajorVer% = GetWindowsMajorVersion()
  48.     MinorVer% = GetWindowsMinorVersion()
  49.     Processor% = GetProcessorType()
  50.     WinDir$ = GetWindowsDir()
  51.     DEST$ = GetWindowsDir()
  52.     WinSysDir$ = GetWindowsSysDir()
  53.     WinSys32Dir$ = WinDir$ + "system32"
  54.  
  55.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  56.         i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  57.         END
  58.     END IF
  59.  
  60.     'Prevents installation on 286
  61.     IF Processor% < 3 THEN
  62.         i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  63.         END
  64.     END IF
  65.  
  66.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  67.     IF OnWindowsNT() THEN
  68.           OnNT$ = "TRUE"
  69.           WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  70.           IF WowVersion$ = "" THEN
  71.              i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  72.              END
  73.           END IF
  74.     END IF
  75.  
  76.     SetBitmap CUIDLL$, LOGO
  77.     SetTitle "Video for Windows 1.1 Runtime"
  78.  
  79.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  80.     IF szInf$ = "" THEN
  81.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  82.     END IF
  83.     ReadInfFile szInf$
  84.  
  85.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  86.  
  87. WELCOME:
  88.  
  89. ''Prepare Copy list and check size
  90.  
  91.     ClearCopyList
  92.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  93.  
  94. '' Remove DCISVGA file
  95.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  96.  
  97. ''  Runtime files (on Windows disk)
  98. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  99.  
  100.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN                   'These files not necessary on Windows NT
  101.         AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  102.         AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  103.     END IF
  104.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  105.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  106.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  107.     IF OnNT$ = "TRUE" THEN
  108.         AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  109.     ENDIF
  110. ''*************************************************************************************************************************
  111. ''*************************************************************************************************************************
  112. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  113. ''and add a "DCI Provider" section with to the SETUP.INF file.
  114. ''
  115. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  116. ''*************************************************************************************************************************
  117. ''*************************************************************************************************************************
  118.  
  119. ''  Check windrive diskspace
  120.     SizeReq& = GetCopyListCost ("","", "")
  121.     IF SizeReq& <> 0 THEN
  122.         GOSUB SMALLWIN
  123.         END
  124.     END IF
  125.  
  126. Install
  127.  
  128.     RESTRT% = RestartListEmpty ()
  129.  
  130. QUIT:
  131.     ON ERROR GOTO ERRQUIT
  132.  
  133.     IF ERR = 0 THEN
  134.         dlg% = EXITSUCCESS
  135.     ELSEIF ERR = STFQUIT THEN
  136.         dlg% = EXITQUIT
  137.     ELSE
  138.         dlg% = EXITFAILURE
  139.     END IF
  140. QUITL1:
  141.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  142.     IF sz$ = "REACTIVATE" THEN
  143.         GOTO QUITL1
  144.     END IF
  145.     UIPop 1
  146.     END
  147.  
  148. ERRQUIT:
  149.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  150.     END
  151.  
  152.  
  153. ASKQUIT:
  154.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  155.  
  156.     IF sz$ = "EXIT" THEN
  157.         UIPopAll
  158. ''        ERROR STFQUIT
  159.         END
  160.     ELSEIF sz$ = "REACTIVATE" THEN
  161.         GOTO ASKQUIT
  162.     ELSE
  163.         UIPop 1
  164.     END IF
  165.     RETURN
  166.  
  167. SMALLWIN:
  168.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  169.     IF sz$ = "REACTIVATE" THEN
  170.         GOTO SMALLWIN
  171.     END IF
  172.     UIPop 1
  173.     RETURN
  174.  
  175. '**
  176. '** Purpose:
  177. '**     Performs all installation operations.
  178. '** Arguments:
  179. '**     none.
  180. '** Returns:
  181. '**     none.
  182. '*************************************************************************
  183. SUB Install STATIC
  184.  
  185.     SetRestartDir WinDir$
  186.     CopyFilesInCopyList
  187.  
  188. ''Updating WIN.INI and SYSTEM.INI
  189. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  190.  
  191. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  192.     IF VflatdPresent() = 0 THEN
  193.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  194.     END IF
  195. END IF
  196.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  197.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  198.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  199.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  200.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  201.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  202.     IF I% = 0  THEN
  203.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  204.     END IF
  205.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  206.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  207.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  208.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  209.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  210.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  211.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  212.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  213.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  214.  
  215. ''*************************************************************************************************************************
  216. ''*************************************************************************************************************************
  217. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  218. ''
  219. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  220. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  221. ''*************************************************************************************************************************
  222. ''*************************************************************************************************************************
  223.  
  224. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  225. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  226.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  227.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  228.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  229.  
  230. '' Mplayer
  231.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  232.  
  233. END IF  ''NT and next version of Windows installation stop here.
  234.  
  235.     Run ("profdisp.exe")
  236. END SUB
  237.  
  238. '**
  239. '** Purpose:
  240. '**     Appends a file name to the end of a directory path,
  241. '**     inserting a backslash character as needed.
  242. '** Arguments:
  243. '**     szDir$  - full directory path (with optional ending "\")
  244. '**     szFile$ - filename to append to directory
  245. '** Returns:
  246. '**     Resulting fully qualified path name.
  247. '*************************************************************************
  248. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  249.     IF szDir$ = "" THEN
  250.         MakePath = szFile$
  251.     ELSEIF szFile$ = "" THEN
  252.         MakePath = szDir$
  253.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  254.         MakePath = szDir$ + szFile$
  255.     ELSE
  256.         MakePath = szDir$ + "\" + szFile$
  257.     END IF
  258. END FUNCTION
  259.